/-app
/-docs ...
/-docs/types ...
/-docs/types/text ...
/-docs/types/text/base
SimpleCodeMirrorDocHandler.ts
/-docs/types/text/css
/-docs/types/text/html
/-docs/types/text/js
/-docs/types/text/json
/-docs/types/text/less
/-docs/types/text/sass
/-docs/types/text/scrollerView
/-docs/types/text/scss
/-docs/types/text/ts ...
TypeScriptDocHandler.ts
CodeMirror-ext.css
CodeMirrorDocHandler.ts
api.ts
load.ts
api.ts
listSubmodules.ts
load.ts
DocHost.ts
/-files
/-imports
/-persistence
/-typescript
ExternalDocument.ts
ScriptDocumentSnapshot.ts
ScriptDocumentState.ts
TypeScriptService.ts
/-typings
codemirror.addons.d.ts
codemirror.d.ts
knockout.d.ts
typescriptServices.d.ts
websql.d.ts
zip.d.ts
errors.js
functions.ts
index.html
try.js
 
1
module teapo.docs.types.text.ts {
2
​
3
  export var expectsFile = /.*\.ts/g;
4
  export var acceptsFile = /.*\.ts/g;
5
​
6
  export function loadText(path: string, storage: DocState): CodeMirrorTextDoc {
7
    return new TypeScriptDocHandler();
8
  }
9
​
10
  export class TypeScriptDocHandler
11
    extends base.SimpleCodeMirrorDocHandler
12
    implements typescript.ExternalDocument {
13
​
14
    private _changes: TypeScript.TextChangeRange[] = [];
15
​
16
    constructor() {
17
      super();
18
    }
19
​
20
    load(text: string) {
21
    }
22
​
23
    open() {
24
    }
25
​
26
    shouldTriggerCompletion(textBeforeCursor: string) {
27
      return false;
28
    }
29
    
30
    getCompletions(): any {
31
    }
32
​
33
    onChanges(docChanges: CodeMirror.EditorChange[], summary: ChangeSummary) {
34
​
35
      this._changes.push(new TypeScript.TextChangeRange(
36
        new TypeScript.TextSpan(summary.lead, summary.mid),
37
        summary.mid));
38
​
39
      super.onChanges(docChanges, summary);
40
    }
41
​
42
    changes(): TypeScript.TextChangeRange[] {
43
      return this._changes;
44
    }
45
​
46
  }
47
​
48
  export function createCodeMirrorDoc(text: string): CodeMirror.Doc {
49
    return new CodeMirror.Doc(text || '', 'typescript');
50
  }
51
​
52
​
53
}
26:13